

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>AMDGPU Instructions Notation &#8212; LLVM 9 documentation</title>
    <link rel="stylesheet" href="_static/llvm-theme.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Stack maps and patch points in LLVM" href="StackMaps.html" />
    <link rel="prev" title="AMDGPU Instruction Syntax" href="AMDGPUInstructionSyntax.html" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
</style>

  </head><body>
<div class="logo">
  <a href="index.html">
    <img src="_static/logo.png"
         alt="LLVM Logo" width="250" height="88"/></a>
</div>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="StackMaps.html" title="Stack maps and patch points in LLVM"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="AMDGPUInstructionSyntax.html" title="AMDGPU Instruction Syntax"
             accesskey="P">previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="AMDGPUUsage.html" accesskey="U">User Guide for AMDGPU Backend</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">AMDGPU Instructions Notation</a></li> 
      </ul>
    </div>


    <div class="document">
      <div class="documentwrapper">
          <div class="body" role="main">
            
  <div class="section" id="amdgpu-instructions-notation">
<h1>AMDGPU Instructions Notation<a class="headerlink" href="#amdgpu-instructions-notation" title="Permalink to this headline">¶</a></h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#introduction" id="id4">Introduction</a></p></li>
<li><p><a class="reference internal" href="#instructions" id="id5">Instructions</a></p>
<ul>
<li><p><a class="reference internal" href="#notation" id="id6">Notation</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#opcode" id="id7">Opcode</a></p>
<ul>
<li><p><a class="reference internal" href="#id1" id="id8">Notation</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#operands" id="id9">Operands</a></p>
<ul>
<li><p><a class="reference internal" href="#amdgpu-syn-instruction-operand-notation" id="id10">Notation</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#modifiers" id="id11">Modifiers</a></p>
<ul>
<li><p><a class="reference internal" href="#amdgpu-syn-instruction-modifier-notation" id="id12">Notation</a></p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="introduction">
<span id="amdgpu-syn-instruction-notation"></span><h2><a class="toc-backref" href="#id4">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>This is an overview of notation used to describe the syntax of AMDGPU assembler instructions.</p>
<p>This notation mimics the <a class="reference internal" href="AMDGPUInstructionSyntax.html#amdgpu-syn-instructions"><span class="std std-ref">syntax of assembler instructions</span></a>
except that instead of real operands and modifiers it provides references to their description.</p>
</div>
<div class="section" id="instructions">
<h2><a class="toc-backref" href="#id5">Instructions</a><a class="headerlink" href="#instructions" title="Permalink to this headline">¶</a></h2>
<div class="section" id="notation">
<h3><a class="toc-backref" href="#id6">Notation</a><a class="headerlink" href="#notation" title="Permalink to this headline">¶</a></h3>
<p>This is the notation used to describe AMDGPU instructions:</p>
<blockquote>
<div><p><code class="docutils literal notranslate"><span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-opcode-notation"><span class="std std-ref">opcode description</span></a><code class="docutils literal notranslate"><span class="pre">&gt;</span>&#160; <span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-operands-notation"><span class="std std-ref">operands description</span></a><code class="docutils literal notranslate"><span class="pre">&gt;</span>&#160; <span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-modifiers-notation"><span class="std std-ref">modifiers description</span></a><code class="docutils literal notranslate"><span class="pre">&gt;</span></code></p>
</div></blockquote>
</div>
</div>
<div class="section" id="opcode">
<span id="amdgpu-syn-opcode-notation"></span><h2><a class="toc-backref" href="#id7">Opcode</a><a class="headerlink" href="#opcode" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id1">
<h3><a class="toc-backref" href="#id8">Notation</a><a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>TBD</p>
</div>
</div>
<div class="section" id="operands">
<span id="amdgpu-syn-instruction-operands-notation"></span><h2><a class="toc-backref" href="#id9">Operands</a><a class="headerlink" href="#operands" title="Permalink to this headline">¶</a></h2>
<p>An instruction may have zero or more <em>operands</em>. They are comma-separated in the description:</p>
<blockquote>
<div><p><code class="docutils literal notranslate"><span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-operand-notation"><span class="std std-ref">description of operand 0</span></a><code class="docutils literal notranslate"><span class="pre">&gt;,</span> <span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-operand-notation"><span class="std std-ref">description of operand 1</span></a><code class="docutils literal notranslate"><span class="pre">&gt;,</span> <span class="pre">...</span></code></p>
</div></blockquote>
<p>The order of <em>operands</em> is fixed. <em>Operands</em> cannot be omitted
except for special cases described below.</p>
<div class="section" id="amdgpu-syn-instruction-operand-notation">
<span id="id2"></span><h3><a class="toc-backref" href="#id10">Notation</a><a class="headerlink" href="#amdgpu-syn-instruction-operand-notation" title="Permalink to this headline">¶</a></h3>
<p>An operand is described using the following notation:</p>
<blockquote>
<div><p><em>&lt;name&gt;&lt;tag0&gt;&lt;tag1&gt;…</em></p>
</div></blockquote>
<p>Where:</p>
<ul class="simple">
<li><p><em>name</em> is a link to a description of the operand.</p></li>
<li><p><em>tags</em> are optional. They are used to indicate special operand properties:</p></li>
</ul>
<blockquote id="amdgpu-syn-instruction-operand-tags">
<div><table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 85%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Operand tag</p></th>
<th class="head"><p>Meaning</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>:opt</p></td>
<td><p>An optional operand.</p></td>
</tr>
<tr class="row-odd"><td><p>:m</p></td>
<td><p>An operand which may be used with
<a class="reference internal" href="AMDGPUModifierSyntax.html#amdgpu-synid-vop3-operand-modifiers"><span class="std std-ref">VOP3 operand modifiers</span></a> or
<a class="reference internal" href="AMDGPUModifierSyntax.html#amdgpu-synid-sdwa-operand-modifiers"><span class="std std-ref">SDWA operand modifiers</span></a>.</p></td>
</tr>
<tr class="row-even"><td><p>:dst</p></td>
<td><p>An input operand which may also serve as a destination
if <a class="reference internal" href="AMDGPUModifierSyntax.html#amdgpu-synid-glc"><span class="std std-ref">glc</span></a> modifier is specified.</p></td>
</tr>
<tr class="row-odd"><td><p>:fx</p></td>
<td><p>This is an <em>f32</em> or <em>f16</em> operand depending on
<a class="reference internal" href="AMDGPUModifierSyntax.html#amdgpu-synid-mad-mix-op-sel-hi"><span class="std std-ref">m_op_sel_hi</span></a> modifier.</p></td>
</tr>
<tr class="row-even"><td><p>:&lt;type&gt;</p></td>
<td><p>Operand <em>type</em> differs from <em>type</em>
<a class="reference internal" href="AMDGPUInstructionSyntax.html#amdgpu-syn-instruction-type"><span class="std std-ref">implied by the opcode name</span></a>.
This tag specifies actual operand <em>type</em>.</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">src1</span><span class="p">:</span><span class="n">m</span>             <span class="o">//</span> <span class="n">src1</span> <span class="n">operand</span> <span class="n">may</span> <span class="n">be</span> <span class="n">used</span> <span class="k">with</span> <span class="n">operand</span> <span class="n">modifiers</span>
<span class="n">vdata</span><span class="p">:</span><span class="n">dst</span>          <span class="o">//</span> <span class="n">vdata</span> <span class="n">operand</span> <span class="n">may</span> <span class="n">be</span> <span class="n">used</span> <span class="k">as</span> <span class="n">both</span> <span class="n">source</span> <span class="ow">and</span> <span class="n">destination</span>
<span class="n">vdst</span><span class="p">:</span><span class="n">u32</span>           <span class="o">//</span> <span class="n">vdst</span> <span class="n">operand</span> <span class="n">has</span> <span class="n">u32</span> <span class="nb">type</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="modifiers">
<span id="amdgpu-syn-instruction-modifiers-notation"></span><h2><a class="toc-backref" href="#id11">Modifiers</a><a class="headerlink" href="#modifiers" title="Permalink to this headline">¶</a></h2>
<p>An instruction may have zero or more optional <em>modifiers</em>. They are space-separated in the description:</p>
<blockquote>
<div><p><code class="docutils literal notranslate"><span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-modifier-notation"><span class="std std-ref">description of modifier 0</span></a><code class="docutils literal notranslate"><span class="pre">&gt;</span> <span class="pre">&lt;</span></code><a class="reference internal" href="#amdgpu-syn-instruction-modifier-notation"><span class="std std-ref">description of modifier 1</span></a><code class="docutils literal notranslate"><span class="pre">&gt;</span> <span class="pre">...</span></code></p>
</div></blockquote>
<p>The order of <em>modifiers</em> is fixed.</p>
<div class="section" id="amdgpu-syn-instruction-modifier-notation">
<span id="id3"></span><h3><a class="toc-backref" href="#id12">Notation</a><a class="headerlink" href="#amdgpu-syn-instruction-modifier-notation" title="Permalink to this headline">¶</a></h3>
<p>A <em>modifier</em> is described using the following notation:</p>
<blockquote>
<div><p><em>&lt;name&gt;</em></p>
</div></blockquote>
<p>Where <em>name</em> is a link to a description of the <em>modifier</em>.</p>
</div>
</div>
</div>


            <div class="clearer"></div>
          </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="StackMaps.html" title="Stack maps and patch points in LLVM"
             >next</a> |</li>
        <li class="right" >
          <a href="AMDGPUInstructionSyntax.html" title="AMDGPU Instruction Syntax"
             >previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="AMDGPUUsage.html" >User Guide for AMDGPU Backend</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">AMDGPU Instructions Notation</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2003-2020, LLVM Project.
      Last updated on 2020-09-20.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
    </div>
  </body>
</html>